import * as fgui from "fairygui-cc";
import AbstractUIWindow from "../../window/AbstractUIWindow";
import UICore from "../../../../Core/Res/UICore";
import ModuleWindow from "../../window/ModuleWindow";
import WindowObject from "../../window/WindowObject";
import EventMgr from "../../../../Core/Event/EventMgr";
import { GameModels } from "../../socket/GameModels";
export class TeachingWindow extends AbstractUIWindow {
    private ctrl_state: fgui.Controller;
    private down: fgui.GButton;
    private up: fgui.GButton;
    private page: fgui.GTextField;
    private __page: number = 6;
    protected getResList(): Array<string> {
        return [`Plane`];
    }
    protected onInit(): void {
        this._view = UICore.createObject("Plane", "TeachingWindow").asCom;
    }
    protected onShow(): void {
        this.up.onClick(this.clickup, this);
        this.down.onClick(this.clickdown, this);
        this.page.text = `${this.ctrl_state.selectedIndex + 1}/${this.__page}`;
    }
    private clickup(): void {
        if (this.ctrl_state.selectedIndex <= 0) {
            return;
        }
        this.ctrl_state.selectedIndex -= 1;
        this.page.text = `${this.ctrl_state.selectedIndex + 1}/${this.__page}`;

    }
    private clickdown(): void {
        if (this.ctrl_state.selectedIndex >= 5) {
            return;
        }
        this.ctrl_state.selectedIndex += 1;
        this.page.text = `${this.ctrl_state.selectedIndex + 1}/${this.__page}`;
    }
}